// @ts-ignore
/* eslint-disable */
import { request } from '@umijs/max';
const apiPrefix = '/web';

/** 绑定出厂设备 POST /station/trm/${param0}/bind */
export async function stationTrmControllerBind(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.stationTrmControllerBindParams,
  body: API.BindFactoryDeviceDTO,
  options?: { [key: string]: any },
) {
  const { trm_id: param0, ...queryParams } = params;
  return request<API.ApiResultVoid>(`${apiPrefix}/station/trm/${param0}/bind`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    params: { ...queryParams },
    data: body,
    ...(options || {}),
  });
}

/** 解绑出厂设备 POST /station/trm/${param0}/unbind */
export async function stationTrmControllerUnbind(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.stationTrmControllerUnbindParams,
  options?: { [key: string]: any },
) {
  const { trm_id: param0, ...queryParams } = params;
  return request<API.ApiResultVoid>(`${apiPrefix}/station/trm/${param0}/unbind`, {
    method: 'POST',
    params: { ...queryParams },
    ...(options || {}),
  });
}

/** 新增设备 新增设备 POST /station/trm/add */
export async function stationTrmControllerAddTrm(
  body: API.StationTrmReq,
  options?: { [key: string]: any },
) {
  return request<boolean>(`${apiPrefix}/station/trm/add`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 批量删除 批量删除 DELETE /station/trm/batch/remove */
export async function stationTrmControllerBatchRemove(
  body: number[],
  options?: { [key: string]: any },
) {
  return request<API.ApiResultVoid>(`${apiPrefix}/station/trm/batch/remove`, {
    method: 'DELETE',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 导出文件 导出文件 GET /station/trm/download/excel */
export async function stationTrmControllerDownloadExcel(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.stationTrmControllerDownloadExcelParams,
  options?: { [key: string]: any },
) {
  return request<any>(`${apiPrefix}/station/trm/download/excel`, {
    method: 'GET',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** 编辑设备 编辑设备 POST /station/trm/edit */
export async function stationTrmControllerEditTrm(
  body: API.StationTrmReq,
  options?: { [key: string]: any },
) {
  return request<boolean>(`${apiPrefix}/station/trm/edit`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 采集设备列表 采集设备列表查询 GET /station/trm/list */
export async function stationTrmControllerList(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.stationTrmControllerListParams,
  options?: { [key: string]: any },
) {
  return request<API.ApiResultPaginationStationTrm>(`${apiPrefix}/station/trm/list`, {
    method: 'GET',
    params: {
      ...params,
      page: undefined,
      ...params['page'],
    },
    ...(options || {}),
  });
}

/** 删除设备 删除单条记录 DELETE /station/trm/remove/${param0} */
export async function stationTrmControllerRemove(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.stationTrmControllerRemoveParams,
  options?: { [key: string]: any },
) {
  const { id: param0, ...queryParams } = params;
  return request<API.ApiResultVoid>(`${apiPrefix}/station/trm/remove/${param0}`, {
    method: 'DELETE',
    params: { ...queryParams },
    ...(options || {}),
  });
}

/** 导入文件 导入文件数据 POST /station/trm/upload/excel */
export async function stationTrmControllerUploadExcel(body: {}, options?: { [key: string]: any }) {
  return request<API.ApiResultVoid>(`${apiPrefix}/station/trm/upload/excel`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}
